﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
/****************************** Module Header ******************************\
 * Module Name:  CaptchaImage.cs
 * Module Version:  1.0.0 (2012-11-15)
 * Copyright (c) AnyEB.Com (14507247@qq.com)
 * 
 * This componse is use for the captcha.
 * 
 * This source is subject to the GPL License.
 * See http://www.gnu.org/licenses/gpl.html.
 * All other rights reserved.
 * 
 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 
 * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED 
 * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
\***************************************************************************/
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace UCL.Web.CustomControls
{
    /// <summary>
    /// 验证码图形控件
    /// </summary>
    [DefaultProperty("Text")]
    [ToolboxData("<{0}:CaptchaImage runat=server></{0}:CaptchaImage>")]
    public class CaptchaImage : Image
    {
        public override void RenderControl(HtmlTextWriter writer)
        {
            this.Attributes["style"] = "cursor:pointer;";
            this.Attributes["title"] = "看不清楚，再换一张";
            this.Attributes["onclick"] =string.Format( "$(this).attr('src','{0}?r'+Math.Random());",ImageUrl);
            base.RenderControl(writer);
        }
    }
}
